package com.nightsoul.springboottest2.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.nightsoul.springboottest2.domain.User;
import com.nightsoul.springboottest2.mapper.test1.UserMapper1;
import com.nightsoul.springboottest2.mapper.test2.UserMapper2;

@Service
@Transactional
public class UserServiceImpl implements UserService {
	@Resource
	private UserMapper1 userMapper1;

	@Resource
	private UserMapper2 userMapper2;

	@Transactional(readOnly=true, propagation=Propagation.NOT_SUPPORTED)
	@Override
	public List<User> getUsers() {
		return this.userMapper1.findAll();
	}

	@Override
	public void saveUser(User user) {
		this.userMapper2.save(user);
	}
}
